import cv2

img1 = cv2.imread("cpshenhe.jpg")  # 读取图像 imgGaia
img2 = cv2.imread("cpyelan.jpg")  # 读取图像 imgLena

imgAddW1 = cv2.addWeighted(img1, 0.15, img2, 0.85, 0)  # 加权相加, a=0.15, b=0.85
imgAddW2 = cv2.addWeighted(img1, 0.5, img2, 0.5, 0)  # 加权相加, a=0.5, b=0.5
imgAddW3 = cv2.addWeighted(img1, 0.85, img2, 0.15, 0)  # 加权相加, a=0.85, b=0.15

cv2.imshow("a=0.15, b=0.85", imgAddW1)
cv2.imshow("a=0.5, b=0.5", imgAddW2)
cv2.imshow("a=0.85, b=0.15", imgAddW3)

cv2.waitKey(0)
cv2.destroyAllWindows()
